import http from '@/util/http'

export function delRole (id) {
  return http.delete(`/roles?id=${id}`)
}

export function menuListByRoleId (roleId) {
  return http.get(`/role/menuListByRoleId?roleId=${roleId}`)
}

export function repeatRole (params) {
  return http.get(`/role/repeat?${params}`)
}

export function roleList (search, current, pageSize) {
  return http.post(`/role/get?pageNo=${current}&pageSize=${pageSize}`, search)
}

export function roleListByUserId (userId) {
  return http.get(`/roleListByUserId?userId=${userId}`)
}

export function allRole () {
  return http.get('/role/list')
}
